'''
Created on May 16, 2010

@author: william
'''

import sys_state

# Detects what distribution is running so the package manager can make
# the corresponding system commands
def pkg_detect():

    # Gets what distribution is running on the client machine.
    distro = sys_state.os()['Distrubution']['Distribution']
    
    if distro == 'Ubuntu' \ # Debian based distributions use APT
    or distro == 'Debian':
        packagemgr = 'apt'
        
    elif distro == 'Fedora' \
    or distro == 'Redhat' \
    or distro == 'CentOS':
        packagemgr = 'yum'
    
    else:
        packagemgr = 'unknown'
        
    print packagemgr
    
pkg_detect()